﻿using Corina.Datamodel.Base;
using Corina.Datamodel.Interface;
using Corina.Enumerations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

namespace Corina.Datamodel.Entities
{
    [XmlTypeAttribute(Namespace = "http://tempuri.org/")]
    public class MessageNotificationInfo : DatamodelEntity, IMessageNotification
    {
        #region Fields
        private int _id;
        private string _dataTable;
        private string _idOrGuid;
        private NotifyTypeValue _notifyType = NotifyTypeValue.Email;
        private bool _read = false;
        #endregion

        #region Properties
        public int Id
        {
            get { return _id; }
            set
            {
                _id = value;
                RaisePropertyChanged(() => Id);
            }
        }
        public string DataTable
        {
            get { return _dataTable; }
            set
            {
                _dataTable = value;
                RaisePropertyChanged(() => DataTable);
            }
        }
        public string IdOrGuid
        {
            get { return _idOrGuid; }
            set
            {
                _idOrGuid = value;
                RaisePropertyChanged(() => IdOrGuid);
            }
        }
        public NotifyTypeValue NotifyType
        {
            get { return _notifyType; }
            set
            {
                _notifyType = value;
                RaisePropertyChanged(() => NotifyType);
            }
        }

        public bool Read
        {
            get { return _read; }
            set
            {
                _read = value;
                RaisePropertyChanged(() => Read);
            }
        }
        #endregion

        protected override IEnumerable<DatabaseColumn> InitColumns()
        {
            yield return new DatabaseColumn("Id", true);
            yield return new DatabaseColumn("DataTable");
            yield return new DatabaseColumn("IdOrGuid");
            yield return new DatabaseColumn("NotifyType");
            yield return new DatabaseColumn("Read");
        }
    }
}